<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>中国福利彩票</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<!--页面样式-->
<link rel="stylesheet" type="text/css" href="css/style.css" />

</head>
<body  style="width:10rem !important; margin:0 auto">
<script>
/*取设备宽度*/
	function rem(){
	var iWidth=document.documentElement.getBoundingClientRect().width;
	iWidth=iWidth>640?640:iWidth;
	document.getElementsByTagName("html")[0].style.fontSize=iWidth/10+"px";
	};
	rem();
	window.onorientationchange=window.onresize=rem      
</script>
<script src="js/jquery-1.7.2.min.js"></script>
	<div class="Header">
<!--     	<div class="left H_logot"><a href="MemberCenter.html"><img src="images/Nimg5.png"></a></div> -->
        <div class="left H_content text-center font28 cfffff">设置新密码</div>
        <div class="right H_right text-right font24"><a href="MemberCenter.html"><img src="images/Nimg4.png"></a></div>
        <div class="clear"></div>
    </div>
    
    <div class="Forgetpwd">
    
    	<div class="FPWD_li">
    		<dl>
    			<dt><img src="images/Fimg2.png"></dt>
    			<dd><input type="password" class="DT_text1 font28 c666666 Weiruan" placeholder="原密码" id="oriPwd"></dd>
    			<div class="clear"></div>
    		</dl>
            <dl>
    			<dt><img src="images/Fimg2.png"></dt>
    			<dd><input type="password" class="DT_text1 font28 c666666 Weiruan" placeholder="新密码" id="newPwd"></dd>
    			<div class="clear"></div>
    		</dl>
            <dl>
    			<dt><img src="images/Fimg2.png"></dt>
    			<dd><input type="password" class="DT_text1 font28 c666666 Weiruan" placeholder="确认密码" id="rePwd"></dd>
    			<div class="clear"></div>
    		</dl>
    	</div>
        
        <div class="FPWD_1">
        	<input type="submit" value="完 成" class="FPWD_but font32 cfffff Weiruan marginT80"  onclick="pwdChange()" />
        </div>
    </div>
<!-- 弹出alert -->
	<div class="falert" style="display: none;" id="warnInfoDiv">

		<div class="falert_t font30">
			<span style="margin-left: 0.15rem">提示</span>
		</div>
		<div class="falert_b">
			<span id="warnInfo"></span><img class="dianji_gb"
				style="position: absolute; right: 0.1rem; top: 0.15rem; cursor: pointer;"
				width="45rem" src="images/Fimg8.png"
				onclick="closeWarnInfoDiv('warnInfoDiv')" />
		</div>
	</div>
	<!-- 弹出alert -->
</body>
<script type="text/javascript">
	var channelId="";
	var accountId="";
	var token="";
   $(document).ready(function() {
		channelId = getCookie("channelId");
		accountId = getCookie("accountId");
		token = getCookie("token");
	});
	//修改登录密码
	function pwdChange() {
		//验证原始密码，新密码，确认密码
		if (!validateUpdateLoginPwd('oriPwd', 'newPwd', 'rePwd')) {
			return;
		}
		
		var para = {
				accountId : accountId,
			password : sha256_digest($('#oriPwd').val()),
			newPassword : sha256_digest($('#newPwd').val()),
			token:token,
			channelId : channelId
		};

		$.ajax({
			url : "../../api/accountSystem/account/pwdChange",
			async : false,
			type : "POST",
			herder : {
				'Accept' : 'application/json',
				'Content-Type' : 'application/json'
			},
			dataType : "json",
			contentType : "application/json",
			data : JSON.stringify(para),
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				alert(errorThrown);
			},
			success : function(data, textStatus) {
				if (data.success == true) {
					window.location.href = 'ModifyWin.html';
				} else {
					window.location.assign(encodeURI('ModifyDown.html?description='+data.description+''));
					return;
				}
			}
		});
	}
</script>
<script src="js/jsCallCookies.js"></script>
<script src="js/SHA256.js"></script>
<script src="js/validation.js"></script>
<script src="js/common.js"></script>
</html>
